package com.xjscrm.console.mapper;

import com.xjscrm.common.entity.WwCustomerTags;
import com.xjscrm.console.param.wwCustomer.WwCustomerTagsQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface WwCustomerTagsMapper {

    List<WwCustomerTags> getWwCustomerTags(WwCustomerTagsQuery wwCustomerTagsQuery);

    int deleCustomerTags(@Param("id") Long id, @Param("merId") Long merId);

    int addWwCustomerTags(WwCustomerTags wwCustomerTags);

    List<WwCustomerTags> selectListByCustomerId(@Param("merId") Long merId, @Param("customerId") Long customerId);

    List<Long> selectListOfCustomerIdsByTagId(@Param("merId") Long merId, @Param("tagIds") List<Long> tagIds);

    Map<Long, Integer> selectMapWithGroupCountByTagIds(@Param("merId") Long merId, @Param("tagIds") List<Long> tagIds);

    List<Long> selectListByTagId(@Param("merId") Long merId, @Param("tagId") Long tagId);

    List<Long> selectListOfCustomerIdsByTagType(@Param("merId") Long merId, @Param("tagType") Integer tagType);

    int deleteByTagIdAndCustomerIds(@Param("merId") Long merId, @Param("tagId") Long tagId, @Param("customerIds") List<Long> customerIds);

    List<WwCustomerTags> queryByCustomerId(@Param("customerId") Long customerId, @Param("merId") Long merId);

}
